<template>
    <div>
        <comp ref="bar" :params="params" :isAutoRender="true" height="300px" width="100%" />
    </div>
</template>
<script>
import comp from "./../bar/index";
export default {
    name: "barBg-test",
    title: "弧度+背景+自动渲染柱子",
    theme: "white",
    components: { comp },
    data() {
        return {
            params: {},
        };
    },
    mounted() {
        this.$nextTick(() => {
            this.params = {
                dataCols: {
                    dimension: ["日期"],
                    legend: {
                        data: ["类型1", "类型2",'类型3'],
                    },
                    series: [
                        {
                            日期: "1-1",
                            类型1: 1,
                            类型2: 5,
                            类型3: 2,
                        },
                        {
                            日期: "1-2",
                            类型1: 2,
                            类型2: 5,
                            类型3: 2,
                        },
                        {
                            日期: "1-3",
                            类型1: 3,
                            类型2: 5,
                            类型3: 2,
                        },
                        {
                            日期: "1-4",
                            类型1: 4,
                            类型2: 5,
                            类型3: 2,
                        },
                        {
                            日期: "1-5",
                            类型1: 4.5,
                            类型2: 5,
                            类型3: 2,
                        },
                    ],
                },
                setting: {
                    theme:'black',
                    color: [],
                    series: {
                        barWidth: "",
                        barBorderRadius: [10],
                        showBackground:true,
                        backgroundStyle: {
            
                        },
                    },
                },
            };
            setInterval(() => {
                this.params.dataCols.series.map(item=>{
                    item['类型3']=Math.ceil(Math.random()*10);
                })
            }, 2000);
        });
    },
};
</script>